#pragma once
#include <stdio.h>
#include <string>
#include "C:\TWS API\samples\Cpp\TestCppClient\TestCppClient.h"

// The following ifdef block is the standard way of creating macros which make exporting 
// from a DLL simpler. All files within this DLL are compiled with the QUANTDLL_EXPORTS
// symbol defined on the command line. This symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see 
// QUANTDLL_API functions as being imported from a DLL, whereas this DLL sees symbols
// defined with this macro as being exported.
#ifdef QUANTDLL_EXPORTS
#define QUANTDLL_API __declspec(dllexport)
#else
#define QUANTDLL_API __declspec(dllimport)
#endif

extern "C" QUANTDLL_API bool tws_connect(const char *host,int port,int clientId);
extern "C" QUANTDLL_API void tws_disconnect();
extern "C" QUANTDLL_API bool tws_isConnected();
extern "C" QUANTDLL_API void tws_processMsgs();
extern "C" QUANTDLL_API void tws_waitForSignal();
extern "C" QUANTDLL_API void tws_readerProcessMsgs();

/* business processing */
//commented since the account List will be pushed by TWS upon connnection
//extern "C" QUANTDLL_API void tws_reqManagedAccounts(int *errorId, int* errorCode);
extern "C" QUANTDLL_API char* tws_getManagedAccounts();
extern "C" QUANTDLL_API void tws_reqAccountUpdates();
extern "C" QUANTDLL_API char* tws_updateAccountValue();
extern "C" QUANTDLL_API void tws_reqAccountSummary();
extern "C" QUANTDLL_API char* tws_updateAccountSummary();
extern "C" QUANTDLL_API void tws_placeOrder(const char* pContract, const char* pOrder);
extern "C" QUANTDLL_API char* tws_orderStatus();
extern "C" QUANTDLL_API void tws_cancelOrder(OrderId id);